export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_materialCode",
          title: {
            "zh-CN": "物料编码",
            "en-US": "sf_materialCode",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_materialName",
          title: {
            "zh-CN": "物料名称",
            "en-US": "sf_materialName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "sf_categoryName",
          title: {
            "zh-CN": "分类名称",
            "en-US": "sf_categoryName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "categoryCode",
          title: {
            "zh-CN": "分类编码",
            "en-US": "categoryCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "modelName",
          title: {
            "zh-CN": "规格",
            "en-US": "modelName",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "typeName",
          title: {
            "zh-CN": "型号",
            "en-US": "typeName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "mainUnit",
          title: {
            "zh-CN": "主单位",
            "en-US": "mainUnit",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "unitName",
          title: {
            "zh-CN": "单位",
            "en-US": "unitName",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "conversionRate",
          title: {
            "zh-CN": "换算率",
            "en-US": "conversionRate",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "processFlag",
          title: {
            "zh-CN": "是否代加工",
            "en-US": "processFlag",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
          render: (h, params) => {
            return h('div', {}, params.row.processFlag=='0'?'否':params.row.processFlag=='1'?'是':'')
          }
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_materialCode",
          title: {
            "zh-CN": "物料编码",
            "en-US": "sf_materialCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_materialName",
          title: {
            "zh-CN": "物料名称",
            "en-US": "sf_materialName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_materialCode",
          title: {
            "zh-CN": "物料编码",
            "en-US": "sf_materialCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_materialName",
          title: {
            "zh-CN": "物料名称",
            "en-US": "sf_materialName",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
        },
      }[this.G_Locale];
    },
  },
};
